package yt.MajorClass.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yt.MajorClass.entity.Xgk;
import yt.MajorClass.mapper.XgkMapper;
import yt.MajorClass.service.IXgkService;
import java.util.List;
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2022-03-24
 */
@Service
public class XgkServiceImpl extends ServiceImpl<XgkMapper, Xgk> implements IXgkService {

    @Autowired
    XgkMapper xgkMapper;

    // ======================= //




    @Override
    public List<Xgk> selectByAny(String zymc, String xlcc, String zydm, String ml, String xk, String zyjs, Integer current, Integer limit) {
        QueryWrapper<Xgk> wrapper = new QueryWrapper<>();
        Page<Xgk> xgkPage = new Page<>(current, limit);
        wrapper.like(StringUtils.isNotBlank(zymc), "zymc", zymc).
                like(StringUtils.isNotBlank(xlcc), "xlcc", xlcc).
                like(StringUtils.isNotBlank(zydm), "zydm", zydm).
                like(StringUtils.isNotBlank(ml), "ml", ml).
                like(StringUtils.isNotBlank(xk), "xk", xk).
                like(StringUtils.isNotBlank(zyjs), "zyjs", zyjs);
        return xgkMapper.selectPage(xgkPage, wrapper).getRecords();
    }



}
